import Vue from 'vue'
import Router from 'vue-router'

// 路由模块
import settingRouter from './modules/setting'
import produnctRouter from './modules/product'
import platformRouter from './modules/platform'
import fileRouter from  './modules/file'
import logisticsRouter from './modules/logistics'

// layout
import Layout from '@/layout'

Vue.use(Router)
const constantRoutes = [{
    path: '/',
    redirect: '/dashboard',
    component: Layout,
    children: [{
      path: 'dashboard',
      name: 'dashboard',
      component: () => import('@/views/dashboard/index'),
      meta: {
        title: '首页',
      }
    }]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index')
  },
]

const asyncRouters = [
  settingRouter,
  produnctRouter,
  platformRouter,
  fileRouter,
  logisticsRouter
];


const router = new Router({
  routes: [...constantRoutes, ...asyncRouters],
  })
console.log(router)
export default router